<?php

/**
 * @version 1.0
 * @created 08-Jun-2009 4:16:31 PM
 */
class SecurityManager
{

	function __construct()
	{
	}
		
	public static function validateUserAccount( User $usr ){
		$dao = DAOFactory::getDAO();
		$result = $dao->getUser( $usr );
		return $result;
	}
	
	public static function getAllRoles(){
		$dao = DAOFactory::getDAO();
		return $dao->getAllRoles();
	}
	
	public static function hasRole( User $user, Role $role ){
		$returnValue = false;
		if( $user->roles[$role->name] ){
			$returnValue = true;
		}
		return $returnValue;
	}

}
?>